UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p2Gxe5NQ/wMyn8ASE4BmMiobMSBHFUJpqLD2clePRyA=' 
WHERE 
  key_id = 'a86ca60751ebccafd757be46ee9bb055c5ae33c1ca8f411a428cc29b4f0d5750' 
  AND (
    token = 'p2Gxe5NQ/wMyn8ASE4BmMiobMSBHFUJpqLD2clePRyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038