UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YfNofHScOamREOoa0d9zqO97P6oy/TYRlLYWqC3h62Q=' 
WHERE 
  key_id = '1370a9e05ef53bb03351ca0a64afcafa97fbac8a9a59bbe5c13be17753cb52e8' 
  AND (
    token = 'YfNofHScOamREOoa0d9zqO97P6oy/TYRlLYWqC3h62Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052