UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Ssj3d0nYiWPHLlniy7ssAADS2zbhPst4j6/Rm6f63E='
WHERE
key_id = '8c6f804d206dc4d9c6f2471dbbb330be63bb0256f3d6d9d4006edb0a97afc77b'
AND (
token = '3Ssj3d0nYiWPHLlniy7ssAADS2zbhPst4j6/Rm6f63E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)