UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AvRCniZNVHeU6EuHMj9SOlBrlGoJdkjwAw9YPxaW1OU='
WHERE
key_id = '570eacdd24bbfab7402bc70a5956c1ec441011d0b24d5acb3dc4c13c4880c9d6'
AND (
token = 'AvRCniZNVHeU6EuHMj9SOlBrlGoJdkjwAw9YPxaW1OU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)