UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Lbt1KGWZqCjRna48o2qwIoPY3ygVpzDGqyrbxd6nb4='
WHERE
key_id = '3bc8d08b36b49124ed468937011d5a62940c97f961f1229e4d25bccb7ee88168'
AND (
token = '3Lbt1KGWZqCjRna48o2qwIoPY3ygVpzDGqyrbxd6nb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)