UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Ceh5KbZec3DFCAqxJW9yNO/QKH2fYVmPkduFW3X1xk='
WHERE
key_id = 'f5e53223559965caca33fe40e90478b602f07fbd6af681ba472b6a22452445ce'
AND (
token = '1Ceh5KbZec3DFCAqxJW9yNO/QKH2fYVmPkduFW3X1xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)