UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bRKnmDCOaUoyk+VVayUckoRKDwUTB27YJh405L7adTw='
WHERE
key_id = '4c2f73426e8f80bd51028ab51263638a585cd75b9a2ed343b65da40ab5613f4c'
AND (
token = 'bRKnmDCOaUoyk+VVayUckoRKDwUTB27YJh405L7adTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)