UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfb8gvbzWRxbguYiDPWaozkgYHzhdpqKskZgagpy5Qc='
WHERE
key_id = 'fe61dfefbc8bf4b5aa365d2d7503d73c5c23dc160598ecf3eff5ddce55d041f2'
AND (
token = 'nfb8gvbzWRxbguYiDPWaozkgYHzhdpqKskZgagpy5Qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)