UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'shZh3CGc0F9BUaE5fdh1LbQy/UtDalXSSbUsfe4snNs=' 
WHERE 
  key_id = 'd5b3a192cbbeebb55e4e534cb06eb4bcdf31ac8cbd1ec0d73979913d622bf3b6' 
  AND (
    token = 'shZh3CGc0F9BUaE5fdh1LbQy/UtDalXSSbUsfe4snNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032