UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/CxsAYN59ZSxoPSLaZvL6FojwImEiwzuhhy2T/Sk+S0='
WHERE
key_id = '6ca5938506ee192892842457c93e56559b8c9259699f4200f38ccaedba2d455c'
AND (
token = '/CxsAYN59ZSxoPSLaZvL6FojwImEiwzuhhy2T/Sk+S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)