UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mqrzPjGEqDOxm6t9iUCiUfI01QxJquuqoMFMp0/MoNg=' 
WHERE 
  key_id = '82d62cb5e7c8437e9c532d31f1d4131d5f94aaa112789efea80f7ab93bc53ac2' 
  AND (
    token = 'mqrzPjGEqDOxm6t9iUCiUfI01QxJquuqoMFMp0/MoNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046