UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sNDiJaYdeAUDvtBgUk+GFU29OXH8TybfKs4NjrdoMeY=' 
WHERE 
  key_id = 'f6280ecfbe126eb07b6928a5b4c30e9e7bdec9a186990fbb557f73cebd8ec183' 
  AND (
    token = 'sNDiJaYdeAUDvtBgUk+GFU29OXH8TybfKs4NjrdoMeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041