UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7AK/sts0sNOEUq7gPuK1/9JgyH8kQtOyJch2AwkSrw='
WHERE
key_id = '5ef543ae8675b7ae08e2051db2913137b37278dac01eae26c712268ce0594b4c'
AND (
token = 's7AK/sts0sNOEUq7gPuK1/9JgyH8kQtOyJch2AwkSrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)