UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43Z+08h5ikMcIv+nE+WhiRz/ZeoN/fCGTNGDq3ELiwo='
WHERE
key_id = 'ef067696f8cdd3b6c77c8a44ab5dadbb8a18e1886d4b761ab91d31bfedb91f52'
AND (
token = '43Z+08h5ikMcIv+nE+WhiRz/ZeoN/fCGTNGDq3ELiwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)