UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NCtocbQmzTauKQKk5+xKCleC0awaOkdvmYKorQAIgL8=' 
WHERE 
  key_id = '76863f6b8ae9f13e067576096125211a46019282f07cab35ffca320595fd7c03' 
  AND (
    token = 'NCtocbQmzTauKQKk5+xKCleC0awaOkdvmYKorQAIgL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020