UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Licm1VvZchVgCbFuKgouuY0H4Ryq+YXcj7mORHbnPo=' 
WHERE 
  key_id = 'c6b49e3c77daaaf9ca4477c2f41a73210fa5868ca35f3f7991f165a113fd909b' 
  AND (
    token = '/Licm1VvZchVgCbFuKgouuY0H4Ryq+YXcj7mORHbnPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031