UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kWsAVD69tMJd17irtYMtCE31I4TBxb3dqKoI2UsM3K8='
WHERE
key_id = '5f778b61084fe26ff65863d284de5c592271d22b0a6fa626f658dcfbc21dd8d2'
AND (
token = 'kWsAVD69tMJd17irtYMtCE31I4TBxb3dqKoI2UsM3K8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)