UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Vg5oqllRV5I+Kwup3zGcXWM4hbchwe28YKn/yo41wk=' 
WHERE 
  key_id = '2528b39dbad1678f660073695bed525931b3959bca0608acae8f52b81a47f382' 
  AND (
    token = '4Vg5oqllRV5I+Kwup3zGcXWM4hbchwe28YKn/yo41wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025