UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jifmLgYsHOtBqlSou2sntUJZ/5dqdDgY/4Ch/Qm71eg='
WHERE
key_id = '883066b9c3eae54c2f700534f8009735d4d8b6a9130f3adecc4226e48141614d'
AND (
token = 'jifmLgYsHOtBqlSou2sntUJZ/5dqdDgY/4Ch/Qm71eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)