UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ivJkY59aM/Y0BVuD1/94PdtNX8HdcUJJgrBpKGQU0V8='
WHERE
key_id = 'c0179dd669ebc0f57ffff6298a2f27e497b91ffbd0362db33e0b8aef83d1605c'
AND (
token = 'ivJkY59aM/Y0BVuD1/94PdtNX8HdcUJJgrBpKGQU0V8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)