UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ilj8ZN7JigLoSSGd5O+eUIgXFGytCiiPcU5/ArreelQ=' 
WHERE 
  key_id = '5bd3942c494a7d4c39724dd87c814256f207f7dc1e278487b70cfe095159e877' 
  AND (
    token = 'ilj8ZN7JigLoSSGd5O+eUIgXFGytCiiPcU5/ArreelQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019