UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcnmUu6Bdk27v022DuqHKXMJg4wCL0pP2YHHwHzHkBg='
WHERE
key_id = 'b43e6aa2d31ee11a34dffbb0f90266c56bbe6a98a0e1f585f0326af440cc0b44'
AND (
token = 'gcnmUu6Bdk27v022DuqHKXMJg4wCL0pP2YHHwHzHkBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)