UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nsjv1WuZhzX92e/RL+G3tDNUhXoAzDxdR63t7Yl3+No=' 
WHERE 
  key_id = '7bee8ab57b21dc3f5f6b0917384e1549ac86585f218862f81523344ac6e10bae' 
  AND (
    token = 'Nsjv1WuZhzX92e/RL+G3tDNUhXoAzDxdR63t7Yl3+No=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056