UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Q3HtwodHutSdlsPhCwASs6pHIQ3f/c8yRDqRu3D0Go='
WHERE
key_id = '2cdbd8e3685a45bc808a35d8a971e17814ff041a6a1fccb00d4507f1f759b826'
AND (
token = '5Q3HtwodHutSdlsPhCwASs6pHIQ3f/c8yRDqRu3D0Go='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)