UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zOmENAWxsv1MX/4R52aqRkhsJibcOGdAOhmlL0NMFzU=' 
WHERE 
  key_id = '54556b7387ca4092dbdb1e40714b8c8674b8640633160952588a83ef55a000d9' 
  AND (
    token = 'zOmENAWxsv1MX/4R52aqRkhsJibcOGdAOhmlL0NMFzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035