UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FZYyuBaR5E4me7XmwJmw/PmTzpHBvPjG98sc49oneMw=' 
WHERE 
  key_id = '7b9fcb5a7234bc49d8069ffe28ef65600b183c4a2e4e73fea790a645336ee93e' 
  AND (
    token = 'FZYyuBaR5E4me7XmwJmw/PmTzpHBvPjG98sc49oneMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023