UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tAfBLJE4d5OYQYPQGsQns00ib0jm7rrxAjP+jtkUIfc=' 
WHERE 
  key_id = '4789666fa1e3dd59ff72c60845076b1fbc08ba3ccf7f42c642a0ae0dedc30c25' 
  AND (
    token = 'tAfBLJE4d5OYQYPQGsQns00ib0jm7rrxAjP+jtkUIfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048