UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hTffQe5UfHt+na8pRZ6jOj4b9EeI7ciHaoQSDmBe1Ss=' 
WHERE 
  key_id = '760f7ddfb78e7963ca5f1c185597553964c1eddaa21a8dfab64f438fc7c804d1' 
  AND (
    token = 'hTffQe5UfHt+na8pRZ6jOj4b9EeI7ciHaoQSDmBe1Ss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050