UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vAqwWrSEQrUd+GazRR/Fkdx6D1R9yc+bYFVGO+q9P6k='
WHERE
key_id = '4940694a7c739bc441423e584128acdbfa9a1be700c71410bf7bf16fdb0a5cc1'
AND (
token = 'vAqwWrSEQrUd+GazRR/Fkdx6D1R9yc+bYFVGO+q9P6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)