UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hdd1fYuw5qNBoLgNw44rGDlzEBkgchjQ9GRNqtzihW0=' 
WHERE 
  key_id = '1ed4abeddf3fc6e002937c3d2b24a54a84631fc369feca60f7a1f8bab192ed1d' 
  AND (
    token = 'Hdd1fYuw5qNBoLgNw44rGDlzEBkgchjQ9GRNqtzihW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034