UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I+bT+Zt7fj8PKLBekIwETuKXDRR+A0SKh8q3OiUHB/4='
WHERE
key_id = 'b428411261d040e5fa9af107e25be8fc55c9a2e1a6d7a86842755144042499b7'
AND (
token = 'I+bT+Zt7fj8PKLBekIwETuKXDRR+A0SKh8q3OiUHB/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)