UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vAyp2VMJfxGpGzkIA5yicM6QdieOmw6q6tqt9OjYbnc=' 
WHERE 
  key_id = '849f1190d80e863d3abdb6081b5e7adba7fb720146026f74711d7610ce12c262' 
  AND (
    token = 'vAyp2VMJfxGpGzkIA5yicM6QdieOmw6q6tqt9OjYbnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037